<template>
  <div class="main">
    <Header />
    <div class="content">
      <div class="datalist">
        <div class="item" v-for="(item, idx) in datalist" :key="idx">
          <img :src="item.pic" />
          <div class="title">{{ item.title }}</div>
          <div class="desc">{{ item.desc }}</div>
        </div>
      </div>
      <Pager />
      <Copyright />
    </div>
  </div>
</template>

<script>
import Header from './Header.vue'
import Pager from './Pager.vue'
import Copyright from './Copyright.vue'
export default {
  name: 'HelloWorld',
  components: {
    Header,
    Pager,
    Copyright
  },
  data () {
    return {
      title: '管理系统',
      menu: ['xx资源0', 'xx资源1', 'xx资源2', 'xx资源3']
    }
  },
  computed: {
    copyright () {
      return `版权所有 @2001 ~ ${new Date().getFullYear()} 曙光信息产业股份有限公司 津CP备10200542号`
    },
    datalist () {
      const _list = []
      for (let index = 0; index < 8; index++) {
        _list.push({
          pic: require(`./../assets/menu/${index + 1}.jpeg`),
          title: '管理系统',
          desc: '这是一段内容描述，这是一段内容描述，这是一段内容描述'
        })
      }
      return _list
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->

<style lang="scss">
.main {
  display: flex;
  flex-direction: column;

  .content {
    margin: 30px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    .datalist {
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      justify-content: center;
      margin: 10px;

      .item {
        width: 300px;
        height: 300px;
        display: flex;
        flex-direction: column;
        margin: 10px 25px;
        align-items: center;
        flex-wrap: wrap;
        padding: 0 20px;
        justify-content: center;
        border-radius: 20px;
        background: #ffffff;

        img {
          width: 120px;
          height: 120px;
        }
        .title {
          font-weight: 700;
          margin: 15px 0;
        }
      }
    }
  }
}
</style>
